<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>添加商品</title>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="jsp/reset.css">
    <link rel="stylesheet" href="jsp/carts.css">
    <link rel="stylesheet" type="text/css" href="jsp/ddym.css"/>
    <script src="jsp/gsjs.js" type="text/javascript" charset="utf-8"></script>
    <style>
        #tanchu{
            width: 400px;
            height: 600px;
            margin-top: 38px;
            position: fixed;
            margin-left: 400px;
            display: none;
            background-color: #c6c6c6;
            z-index: 1000;
            opacity: 0.8;
        }
        .addifm{
            margin-left: 20px;
            margin-bottom: 30px;
            width: 360px;
            height: 50px;
            line-height: 50px;
            background-color: #eeecec;
        }
    </style>
</head>
<body>
<div id="top">
    <div id="topz">
        <div id="top1">
            <img src="jsp/YNIK%7BT%60J8AT~PQ(8LL9QPJR.png">
        </div>
        <div id="top2">
            <a href="/jump" id="top21">集市首页</a>
        </div>
        <div id="top3">
            <span>欢迎来到本集市，开启新鲜水果之旅！</span>
        </div>
        <div id="top4" style="width: 100px;margin-left: 300px">
            <#if superuser??>
            <a href="login.html" id="top41">你好;${superuser.username}</a>
            <#else>
            <a href="login.html" id="top41">请登录</a>
        </#if>
    </div>
    <div id="top5">
        <a href="register.html" id="top51">免费注册</a>
    </div>
    <div id="top6">
        <a href="/jumpmygoods" id="top61">我的订单</a>
    </div>
    <div id="top7">
        <a href="" id="top71">商家支持</a>
    </div>
    <div id="top8">
        <a href="" id="top81" onmouseover="over()" onmouseout="out()">网站导航</a>
    </div>
    <div id="top9" onmouseover="over()" onmouseout="out()">
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
    </div>
</div>
</div>

<div id="banner">
    <div id="banner1">
        <div id="logo">
            <a href="index.html"><img src="jsp/731.jpg"></a>
        </div>
        <div id="tt" style="width: 140px;height: 40px;float: left;text-align: center;line-height: 40px">
            <a href="index.html" id="tit">蔬果集市</a>
        </div>
        <div id="sc">
        </div>
        <div id="search" style="width: 600px;height: 40px;float: left;padding-top: 3px">
            <div id="search1" style="width: 440px;height: 32px;background-color: #ff4400;padding-top: 4px;margin: auto">
                <form action="http://www.baidu.com/s" method="get">
                    <input type="text" name="wd" id="banner3" value="" size="60" placeholder="请输入您的订单"/>
                    <input type="submit" id="banner4" value="搜索"/>
                </form>
            </div>
        </div>
    </div>
</div>

<section class="cartMain" id="zsp">
    <div class="cartMain_hd">
        <ul class="order_lists cartTop">
            <li class="list_chk"></li>
            <li class="list_con">商品名称</li>
            <li class="list_info">商品描述</li>
            <li class="list_price">单价</li>
            <li class="list_amount">数量</li>
            <li class="list_op">操作</li>
            <li class=""><input type="button" value="拓展种类" style="background-color: #FFFFFF;border: 0px;color: #04f5ed" onclick="display()"></li>
        </ul>
    </div>
    <div id="tanchu">
        <div style="margin-left: 20px;width: 360px;height: 50px;line-height: 50px;margin-bottom: 20px;margin-top: 10px"><h1>addgoods in store</h1></div>
        <form action="/upload" method="post" enctype="multipart/form-data">
            <div class="addifm"><p style="float: left">商品名称:</p><input style="float: left;size: 20;margin-top: 17px" type="text"  name="newgoodsname"></div>
            <div class="addifm"><p style="float: left">商品图片:</p><input style="float: left;size: 20;margin-top: 17px;text-align: center" type="text" id="newgoodspic">
                <input type="file" name="file" accept="image/*" id="scpic" onchange="gb(this)" style="display:none; ">
                <input type="button" value="上传" onclick="cn()"/>
            </div>
            <div class="addifm"><p style="float: left">商品描述:</p><input style="float: left;size: 20;margin-top: 17px" type="text" name="newgoodsdesc"></div>
            <div class="addifm"><p style="float: left">商品单价:</p><input style="float: left;size: 20;margin-top: 17px" type="text" name="newgoodsprice"></div>
            <div class="addifm"><p style="float: left">商品数量:</p><input style="float: left;size: 20;margin-top: 17px" type="text" name="newgoodscount"></div>
            <div style="width: 360px;height: 30px;margin-top: 90px;margin-left: 20px">
                <input style="border: 0px;width: 50px;height: 30px;font-size: 20px;background-color: aquamarine;float: right" type="submit" value="提交">
                <input style="border: 0px;width: 50px;height: 30px;font-size: 20px;margin-right: 30px;background-color: #7fa3ff;float: right" type="button" value="关闭" onclick="trunoff()">
            </div>
        </form>
    </div>


    <div class="cartBox" style="margin-bottom: 0px;">
        <div class="shop_info">
            <div class="shop_name">
                店铺：<input type="text" id="storename">
            </div>
        </div>

        <#list list as list >
        <div class="order_content">
            <ul class="order_lists">
                <li class="list_chk">
                </li>
                <li class="list_con">
                    <div class="list_img"><a href="javascript:;"><img src="${list.goodspic}" alt=""></a></div>
                    <div class="list_text"><a href="javascript:;">${list.goodsname}</a></div>
                </li>
                <li class="list_info" style="width: 232px; margin-right: 20px">
                    <p style="color: black;border: 0px">${list.goodsdesc}</p>
                </li>
                <li class="list_price">
                    <p class="price">￥${list.goodsprice}</p>
                    <input id="goodsprice" value="${list.goodsprice}" type="text" style="display: none">
                </li>
                <li class="list_amount">
                    <div class="amount_box"><!--购买提交的数量-->
                        <a href="javascript:;" class="reduce reSty">-</a>
                        <input type="text" value="${list.goodscount}" class="sum" id="sum">
                        <a href="javascript:;" class="plus">+</a>
                    </div>
                </li>
                <li class="list_op">
                    <p class="del"><a href="javascript:;" class="delBtn" name="${list.goodsid}"
                                      onclick="deleteGoods(this)">移除商品</a></p>
                </li>
            </ul>
        </div>
    </#list>
    </div>
    <hr id="hr">
</section>
<section class="model_bg"></section>
<section class="my_model">
    <p class="title">删除宝贝<span class="closeModel">X</span></p>
    <p>您确认要删除该宝贝吗？</p>
    <div class="opBtn"><a href="javascript:;" class="dialog-sure">确定</a><a href="javascript:;"
                                                                           class="dialog-close">关闭</a></div>
</section>


<div id="di">

    <div id="bottom">
        <div id="bottom1">

        </div>
        <div id="bottom2">
            <div id="bottom21">
                <br>
                <br>
                <span><a href="" class="bm1 gg"><b style="font-size: 14px;">购物指南</b></a></span><br>
                <br>
                <br>
                <span><a href="" class="bm11 gg1">购物流程</a></span><br>
                <br>
                <span><a href="" class="bm12 gg1">会员介绍</a></span><br>
                <br>
                <span><a href="" class="bm13 gg1">生活旅行</a></span><br>
                <br>
                <span><a href="" class="bm14 gg1">常见问题</a></span><br>
                <br>
                <span><a href="" class="bm15 gg1">联系客服</a></span><br>
            </div>
            <div id="bottom22">
                <br>
                <br>
                <span><a href="" class="bm2 gg"><b style="font-size: 14px;">配送方式</b></a></span><br>
                <br>
                <br>
                <span><a href="" class="bm21 gg1">上门自提</a></span><br>
                <br>
                <span><a href="" class="bm22 gg1">211限时达</a></span><br>
                <br>
                <span><a href="" class="bm23 gg1">配送服务查询</a></span><br>
                <br>
                <span><a href="" class="bm24 gg1">配送费收取标准</a></span><br>
                <br>
                <span><a href="" class="bm25 gg1">海外配送</a></span><br>
            </div>
            <div id="bottom23">
                <br>
                <br>
                <span><a href="" class="bm3 gg"><b style="font-size: 14px;">支付方式</b></a></span><br>
                <br>
                <br>
                <span><a href="" class="bm31 gg1">货到付款</a></span><br>
                <br>
                <span><a href="" class="bm32 gg1">在线支付</a></span><br>
                <br>
                <span><a href="" class="bm33 gg1">分期付款</a></span><br>
                <br>
                <span><a href="" class="bm34 gg1">公司转账</a></span><br>
            </div>
            <div id="bottom24">
                <br>
                <br>
                <span><a href="" class="bm4 gg"><b style="font-size: 14px;">售后服务</b></a></span><br>
                <br>
                <br>
                <span><a href="" class="bm41 gg1">售后政策 </a></span><br>
                <br>
                <span><a href="" class="bm42 gg1">价格保护 </a></span><br>
                <br>
                <span><a href="" class="bm43 gg1">退款说明 </a></span><br>
                <br>
                <span><a href="" class="bm44 gg1">返修/退换货 </a></span><br>
                <br>
                <span><a href="" class="bm45 gg1">取消订单</a></span><br>
            </div>
            <div id="bottom25">
                <br>
                <br>
                <span><a href="" class="bm5 gg"><b style="font-size: 14px;">特色服务</b></a></span><br>
                <br>
                <br>
                <span><a href="" class="bm51 gg1">夺宝岛 </a></span><br>
                <br>
                <span><a href="" class="bm52 gg1">DIY装机 </a></span><br>
                <br>
                <span><a href="" class="bm53 gg1">延保服务 </a></span><br>
                <br>
                <span><a href="" class="bm54 gg1"></a></span><br>
                <span><a href="" class="bm55 gg1"></a></span><br>
            </div>
        </div>
        <div id="bottom3">

        </div>
    </div>
</div>

</body>
<script src="jsp/jquery.min.js"></script>
<script src="jsp/carts.js"></script>
<script type="text/javascript">
    function bk() {
        document.getElementById("banner6").style.borderBottom = '0px solid red';
    }

    function hk() {
        document.getElementById("banner6").style.borderBottom = '3px solid red';
    }

    function paymoney() {
        $.ajax({
            url: ("/pay"),
            type: "post",
            data: {
                goodspic: $("#goodspic").val(),
                goodsname: $("#goodsname").val(),
                goodsprice: $("#goodsprice").val(),
                goodscount: $("#sum").val()
            },
            dataType: "text",
            success: function (data) {
                if (data == "paymoney") {
                    location.assign("/paypage")
                }
            }
        })
    }

    function deleteGoods(n) {
        var goodsid = n.name;
        $.ajax({
            url: ("/deleteStoreGoods"),
            type: "post",
            data: {
                goodsid: goodsid
            },
            dataType: "text",
            success: function (data) {
                if (data == "删除商品") {
                    location.assign("/addgoods")
                }
            }
        })
    }
    function display() {
        document.getElementById("tanchu").style.display = "block";
    }
    function trunoff() {
        document.getElementById("tanchu").style.display = "none";
    }
    var x = document.getElementById("scpic");
    function cn(){
        x.click();
    }
    function gb(obj){
        var y = x.files;
        console.log(y);
        document.getElementById("newgoodspic").value = y[0].name;
    }
</script>
</html>
